import Render from "./components/Render";
import HeaderUtil from "./components/HeaderUtil";
import LeftMaterial from "./components/LeftMaterial";
import RightDesign from "./components/RightDesign";
import { currentHandleActions } from "./store";
import { useThrottle } from "./utils";

function Layout() {
  const { clearCurrentAddComponentLocation } = currentHandleActions;

  const clearLocation = useThrottle(clearCurrentAddComponentLocation, 100);

  return (
    <>
      <HeaderUtil clearLocation={clearLocation} />
      <LeftMaterial clearLocation={clearLocation} />
      <Render clearLocation={clearLocation} />
      <RightDesign clearLocation={clearLocation} />
    </>
  );
}

export default Layout;
